/*0+wYoXiCVY9raZXOFEcDv6bk64Tug6WTDCyNy1gUkvif/bNEpLXEgSvL6gm8zD0h*/
/*
 * @Author: xiahui 
 * @PageInfo: 新增
 * @Date: 2019-03-06 16:26:02 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-03-13 08:59:24
 */
import { AREA, LINEITMES, FIELDS } from '../../constance';
import { RownoUtils } from '../../../../../scmpub/scmpub/pub/tool/editTableTools';

export default function(props) {
	let allRows = props.editTable.getAllRows(AREA.listTableId);
	let lastIndex = props.editTable.getNumberOfRows(AREA.listTableId);
	let lastRow = allRows[lastIndex - 1];

	let newRow = { values: {} };
	for (let key in lastRow.values) {
		if (LINEITMES.copyItems.includes(key)) {
			newRow.values[key] = lastRow.values[key];
		}
	}

	props.editTable.addRow(AREA.listTableId, lastIndex, false, newRow.values);
	RownoUtils.setRowNo(props, AREA.listTableId, FIELDS.crowno);
}

/*0+wYoXiCVY9raZXOFEcDv6bk64Tug6WTDCyNy1gUkvif/bNEpLXEgSvL6gm8zD0h*/